<head>
<meta http-equiv='content-type' content='text/html; charset=utf8' />
<title>jsGoo tests</title><link rel='stylesheet' href='main.css' type='text/css' />
<script type='text/javascript' src='jsgoo.js'></script>
<script type='text/javascript'>

function genPage() {
        var d = DATA;
        _.$into('content', _.list(d.posts, d.posttpl));
        _.$into('tabs', _.list(d.tabs, d.tabtpl, 'ul id="tabnav"'));
        _.$into('links', _.list(d.links, d.linktpl, 'ul'));
}

var DATA = {
    posttpl:    "<div><h2>{title}</h2><p>{content}<br/></div>",
    linktpl:   '<li><a href="{link}" title="{descr}">{name}</a></li>',
    tabtpl:     '<li class="{cssclass}"><a href="{path}">{name}</a></li>',
    posts: [
                {   title:"Ocaml code for 2d vectors",
                    content:"Flying Frog consultancy has some great Ocaml tutorials. They also sell a book and access to Ocaml journal. When I made games in c++ I praised the fact that I used 2d vectors for all 2d stuff instead of separate x, y floats. This made code much shorter and I could do tons of simulation with basic vector operations (like acceleration's, forces, collisions, rotations). One of the examples on FF Consultancy includes a very compact set of 2d vector functions and operators also. A great start to begin a dive at Ocaml game-dev experiment.",
                    comments: [ 
                        {   author: "miha",
                            comment: "Abcdef Abcdef Abcdef Abcdef Abcdef Abcdef "},
                        {   author: "miha",
                            comment: "Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl "},
                        {   author: "jimy",
                            comment: "Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl "}
                    ]
                },
                {   title:"Make a $400 app in 30 REBOL lines!?",
                    content:"I said I won't write about REBOL for a while but I must echo this. Yesterday near midnight my client called with a problem at hand. He needed a niche functionality that is not so typical for webapps and is better solved with a separate running process. We googled the net to dig out more info from RFC-s and found 3 such apps that were selling for $400 (the third was a .NET componenet selling for $320). Their descriptions seemed scary and complicated. But I knew that this is a task where rebol's unique features would really shine. So I wrote something that roughly does what that $400 app does in 30 lines of REBOL. Well but I won't tell you what this is. I might develop it further and sell it for half of that price. This is vengeance for all the wtf is rebol, meh, ignore.. moments.",
                    comments: [ 
                        {   author: "miha",
                            comment: "Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl "},
                        {   author: "jimy",
                            comment: "Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl Ghijkl "}
                    ]
                },
                {   title:"Python: Talking to Star Micronics POS printer thrugh serial port",
                    content:"The computer in some shop that uses my program broke this week. Program was written years ago in Python and uses wxPython for GUI. It needed to communicate to those little squeaky printers that print bills. The whole thing looked kind of cute back then and still does. Python talks to the printer directly via serial port (without printer drivers or something like that) and it’s very simple. I used pyserial module. So in case there is someone somewhere who wants to connect his python to one of those particular printers he can do that with this little library.",
                    comments: [ ]
                },
            ],
    links: [
                {   name:"Janko in a Jar",
                    link:"http://itmmetelko.com/blog",
                    descr:"Random rants of a language nut"
                },
                {   name:"Refaktor",
                    link:"http://refaktor.si",
                    descr:"Solutions to some problems"
                },
                {   name:"Brave Kid Games",
                    link:"http://www.bravekidgames.com",
                    descr:"Games for kids"
                }
            ],
    tabs:   [
                { path: "/", name: "Home", cssclass: "tab1" },
                { path: "/about", name: "About", cssclass: "tab2"  }
            ]
}
</script>

<body style="background-color: #f1f1f1;">
<div><a href="index.html">index</a> <a href="#" onclick="genPage(); return false;">generate</a></div>
<center>
<div id="mainbody">
    <div id="header">
        <div id="title">jsGoo's Fake Blog</div>
        <div id="tabs"></div>
    </div>
    <div id="main"> 
        <div id="content">
            <p>This could be called a html shell. There is no "template stuff" here.</p>
            <p>Page get's generated from data by calling <em>list</em> function 3 times. Once for tabs, once for content and once for links.</p>
        </div>
        <div id="rside-content">
            <h3>Some links</h3>
            <div id="links"></div>
        </div>
        <br style="clear: both;" />
    </div>
    <div id="footer">jsGoo pow<b>d</b>ered</div>
</div>
</center>
</body>
</html>